// write a program to find prime number

# include <iostream.h>
# include <conio.h>

class PrimeFinder {
  int number;
public:
  void getNumber();
  void checkPrime();
};

void PrimeFinder::getNumber() {
  cout << "Enter the number: ";
  cin >> number;
}

void PrimeFinder::checkPrime() {
  int rem = 0;
  int ind = 2;
  while(ind < number) {
    if(number % ind++ == 0) {
      cout << "Number is not prime!";
      rem++;
      break;
    }
  }
  if(rem == 0) {
    cout << "Number is prime!";
  }
}

void main() {
  clrscr();
  PrimeFinder pf;
  pf.getNumber();
  pf.checkPrime();
  getch();
}